<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
var url ='https://restapi.amap.com/v3/weather/weatherInfo?key=452affa6b348c8fbc288848e433534a2&city=430300';

var http = new XMLHttpRequest();
http.open('get',url,true);
http.send();

// 状态改变时 触发
http.onreadystatechange = function(){
    if(http.readyState == 4 && http.status == 200){
        let data = http.responseText;  //服务器返回的数据
        console.log(data );
    }
}



</script>  
</body>
</html>